import {request} from "@/core/AxiosConfig";

const base='/user';
export const userApi= {
    //获取用户信息
    getInfo:`${base}/get/usinfo`,
    //用户登录
    sysLogin: `${base}/login`,
    sysLogout:`${base}/logout`,
//用户密码修改API POST
    userUpdatePassword: `${base}/update/resetpassword`,
//用户信息更新api - 普通信息
    userUpdateMessage: `${base}/update`,
//邮箱验证码发送api
//     checkCodeSend: "/CheckCodeApi.js/send",
//用户修改
    userUpdateAdmin: `${base}/update`,
//用户注册api
    userRegister: `${base}/register`,
    userAdd: `${base}/add`,
//通过id获取用户信息 GET
    getUserById: `${base}/get?id:`,
    getUserAccountbyID: `${base}/get/userAccount?id:`,
//获取用户昵称
    getUserNamebyID: `${base}/get/userName?id:`,
    getUserslistPage: `${base}/list/page`,
//删除
    deleteUser: `${base}/delete`,
    /**
     * getUserVOByUserAccount
     * @param {string} userAccount
     * @returns
     */
    getUserVOByUserAccount:(userAccount)=>{
        return request.get(`/user/get/vo/${userAccount}`);
    },
    /**
     * exportUser
     * @param {object} params OperateRequest
     * @param {number} params.id
     * @param {array} params.ids
     * @returns
     */
     exportUser:(params)=> {
        return request.post(`/user/operate/export`, params,{
            responseType: 'blob'
        });
    },
     importUser:(multipartFile)=>{
        return request.post(`/user/operate/import`,multipartFile);
    },
    /**
     * 公钥获取接口
     * @returns
     */
    getPbs:() => {
        return request.get(`/user/pbs`);
    },
    /**
     * UUID获取接口
     * @param {object} params SecretPair
     * @param {string} params.pub
     * @param {string} params.hexMsg
     * @returns
     */
    getUUID:(params) => {
        return request.post(`/user/uuid`, params);
    }
}
